/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.myapp.struts.prepare;

//~--- non-JDK imports --------------------------------------------------------
//~--- JDK imports ------------------------------------------------------------
import com.myapp.struts.beans.ScheduleBean;
import java.sql.*;

import java.util.*;

//class to get arraylist
public class SchedulePrepareAL {
    // instance variable declaration

    ArrayList al = new ArrayList();

//  method to get arraylist
    public ArrayList prepareArrayList(ResultSet rs) {
        try {
            if (rs == null) {
            } // end of if
            else {
                while (rs.next()) {
                    ScheduleBean shb = new ScheduleBean();

                    System.out.println("rs.getString(3)" + rs.getString(3));
                    shb.setSchedule_No(rs.getString(1));
                    shb.setSchedule_Name(rs.getString(2));
                    shb.setSub_Schedule1(rs.getString(3));
                    shb.setSub_Schedule2(rs.getString(4));
                    shb.setDescription(rs.getString(5));
                    shb.setCreatedBy(rs.getString(6));
                    shb.setCreatedDt(rs.getString(7));
                    shb.setSchedule_Status(rs.getString(8));
                    al.add(shb);
                }                 // end of while
            }                     // end of else
        } // end of try
        catch (Exception e) {
            System.out.println("exception at Schedule PrepareArrayList" + e);
        }                         // end of catch

        return al;
    }    // end of arraylist method

        public ArrayList prepareAcHeadList(ResultSet rs) {
        try {
            if (rs == null) {
                
            } // end of if
            else {
                while (rs.next()==true) {
                    if (rs.getString(1)!=null && !rs.getString(1).equals(""))
                    {
                    System.out.println("RS  value-->"+rs.getString(1));
                    ScheduleBean shb1 = new ScheduleBean();
                    shb1.setSub_Schedule1(rs.getString(1));
                    al.add(shb1);
                    }
                }                 // end of while
            }                     // end of else
        } // end of try
        catch (Exception e) {
            System.out.println("exception at Schedule PrepareArrayList" + e);
        }                         // end of catch

        return al;
    }    // end of arraylist method


}    // end of class